<?php
class quantitytypedao extends CI_Model{
	function __construct()
	{
		// Call the Model constructor
		parent::__construct();
	}

	function insert($quantity_type_name){
		$data = array(
				'quantity_type_name' => $quantity_type_name,
		);
		$str = $this->db->insert_string('quantity_type', $data);
		$res = $this->db->query($str);
		if (!$res) {
			return false;
		} else {
			return true;
		}
		
	}
	
	function getbyid($id){
		$this->db->select('*');
		$this->db->from('quantity_type');
		$this->db->where('quantity_type_name',$id);
		$query = $this->db->get();
		$res = $query->row();
		return $res;
	}

	function get_all(){
		$this->db->select('*');
		$this->db->from('quantity_type');
		$query = $this->db->get();
		$res = $query->result();
		return $res;
	}

}
?>